<?php

/**
 * 合同大类仓库
 * @author wangwx 2015-5-12
 */
namespace common\repositories\myhtsq;
use common\repositories\BaseRepository;
use common\support\StringHelper;
use common\entities\myhtsq\ContractBigCategoryEntity;
class ContractBigCategoryRepository extends BaseRepository{

	
	/**
	 * 构造方法
	 * @param unknown $config (optional)
	 */
	public function __construct($config = [])
	{
		parent::__construct($config);
	}
	
	/**
	 * 获取所有合同大类
	 * @return array
	 */
	public static function getAllContractBigClass() {
		return ContractBigCategoryEntity::find()->all();
	}
        
        /**
	 * 根据合同大类id,获取大类名称
	 * @param string $bigCategoryId
	 * @return string
	 */
	public static function getContractBigCategoryNameByBigCategoryId($bigCategoryId){
		return ContractBigCategoryEntity::find()->select('big_category_name')->where(['big_category_id'=>$bigCategoryId])->scalar();
	}

    /**
     * 根据合同大类id,获取大类名称
     * @param $bigCategoryIds
     * @return array
     */
    public static function getAllContractBigCategoryNameByBigCategoryIds($bigCategoryIds){
        return ContractBigCategoryEntity::find()
            ->select('big_category_name,big_category_id')
            ->where(['big_category_id' => $bigCategoryIds])
            ->asArray()
            ->all();
    }
	
	
}